package com.es.hr.rtmCtm;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

import com.opensymphony.webwork.interceptor.ServletRequestAware;
import com.opensymphony.xwork.ActionSupport;

public class DeleteCtmDoAction  extends ActionSupport implements ServletRequestAware{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	HttpServletRequest request;
	 
	   public String execute()throws Exception
	   {
		   String queryRtmCode = request.getParameter("queryRtmCode")==null?"":request.getParameter("queryRtmCode");
		   String del_emp_id = request.getParameter("del_emp_id")==null?"":request.getParameter("del_emp_id");
		   String[] empId = del_emp_id.split(",");

		   RtmCtmBiz manegeBiz = new RtmCtmBiz();
		   ArrayList<ArrayList> queryParms = new ArrayList<ArrayList>();
		   if(empId.length>0){
			   for(int i=0;i<empId.length;i++){
				   ArrayList ary = new  ArrayList();
				   ary.add(empId[i]);				 
				   queryParms.add(ary);
			   }
			   boolean bool = manegeBiz.deleteCTM(queryParms);
			   if(bool)
				   request.setAttribute("message", "删除CTM操作成功！");
			   else
				   request.setAttribute("message", "删除CTM操作产生错误！");
			   request.setAttribute("queryRtmCode", queryRtmCode);
		   }
		   return "success";
	   }
	
	   public void setServletRequest(HttpServletRequest request) {
		     this.request = request;
		   }
}